package com.wb.mas.ui.defer;

import android.os.Bundle;

import androidx.lifecycle.ViewModelProviders;

import com.wb.mas.BR;
import com.wb.mas.R;
import com.wb.mas.app.AppViewModelFactory;
import com.wb.mas.databinding.ActDeferBinding;

import me.goldze.mvvmhabit.base.BaseActivity;

/**
 * Copyright (C) 2018
 * DeferActivity
 * <p>
 * Description
 * 展期
 *
 * @author Administrator
 * @version 1.0
 * <p>
 * Ver 1.0, 2019/5/2 0002, Administrator, Create file
 */
public class DeferActivity extends BaseActivity<ActDeferBinding, DeferViewModel> {

    private String orderId;

    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.act_defer;
    }

    @Override
    public void initParam() {
        super.initParam();
        orderId = getIntent().getStringExtra("orderId");
    }

    @Override
    public DeferViewModel initViewModel() {
        AppViewModelFactory factory = AppViewModelFactory.getInstance(getApplication());
        DeferViewModel deferViewModel = ViewModelProviders.of(this, factory).get(DeferViewModel.class);
        deferViewModel.orderId = orderId;
        return deferViewModel;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }
}
